package com.hp.bon.sgw.bean;

public class OperationResult<T> {
	private boolean success;
	private Integer errorCode;
	private String msgKey;
	private T returnObj;

	public String getMsgKey() {
		return msgKey;
	}

	public T getReturnObj() {
		return returnObj;
	}

	public Integer getErrorCode() {
		return errorCode;
	}

	public boolean isSuccess() {
		return success;
	}

	public OperationResult() {
		this(true);
	}

	public OperationResult(String msgKey) {
		this(false, msgKey, null);
	}

	public OperationResult(boolean success) {
		this(success, "", null);
	}

	public OperationResult(T returnObj) {
		this(true, "", returnObj);
	}

	public OperationResult(boolean success, String msgKey) {
		this(success, msgKey, null);
	}

	public OperationResult(boolean success, T returnObj) {
		this(success, "", null);
	}

	public OperationResult(boolean success, String msgKey, T returnObj) {
		super();
		this.success = success;
		this.msgKey = msgKey;
		this.returnObj = returnObj;
	}

	public OperationResult(boolean success, Integer errorCode, String msgKey,
			T returnObj) {
		super();
		this.success = success;
		this.errorCode = errorCode;
		this.msgKey = msgKey;
		this.returnObj = returnObj;
	}

	public OperationResult(Integer errorCode) {
		super();
		this.success = false;
		this.errorCode = errorCode;
	}

	public OperationResult(Integer errorCode, String errorMsg) {
		super();
		this.success = false;
		this.errorCode = errorCode;
		this.msgKey = errorMsg;
	}

}
